import { LocalStorage } from "@/editor/framework/net/cache/LocalStorage";
import Control from "@/api/data/Control";

export default class Setting extends Control {

    private _data: ISetting;

    get data(): ISetting {
        return this._data;
    }

    constructor() {
        super();
    }

    private getCacheValueByKey(key:any) {
        let value = LocalStorage.getItem(key);
        value = JSON.parse(JSON.stringify(value));
        return value;
    }

    protected initData(): void {
        let setting = './setting/setting.json';
        this.urls.push({ url: setting, method: 'GET', baseURL: '' });
    }

    protected onRequestComplete(res: any): void {
        //需要自己知道第几个
        this._data = res[0];
        console.log('setting:', res);
    }

    protected onRequestError(res: any): void {

    }

    cache() {

    }
}